#include "hintwindow.h"
#include "ui_hintwindow.h"
#include <QGraphicsDropShadowEffect>


//录用指静脉提示窗口
HintWindow::HintWindow(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::HintWindow)
{
    ui->setupUi(this);

    this->setAttribute(Qt::WA_TranslucentBackground);//设置窗口背景透明
    this->setWindowFlags(Qt::FramelessWindowHint);   //设置无边框窗口

    //设置具体阴影
    QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(this);
    shadow_effect->setOffset(0, 0);

    //阴影颜色
    shadow_effect->setColor(QColor(38, 78, 119, 127));
    //阴影半径
    shadow_effect->setBlurRadius(10);
    ui->label_3->setGraphicsEffect(shadow_effect);

    //设置标题字间距
    QFont font;
    font.setLetterSpacing(QFont::PercentageSpacing,120);//120字间距，默认100
    ui->label_2->setFont(font);
}

HintWindow::~HintWindow()
{
    delete ui;
}

//设置窗口提示语
void HintWindow::setText(QString data)
{
    ui->label_2->setText(data);
}

//设置图标(0->错误提示图标,1->正确提示图标)
void HintWindow::setPicture(int n)
{
    if(n == 0)
    {
        ui->label->setStyleSheet("border-image: url(:/new/prefix1/resource/19.png);");
    }
    if(n == 1)
    {
        ui->label->setStyleSheet("border-image: url(:/new/prefix1/resource/18.png);");
    }
}
